<?php

use yii\db\Schema;
use yii\db\Migration;

class m150717_023414_advertiser_map_add extends Migration
{
    public function up()
    {
    	$this->addColumn('{{%advertiser_map}}', 'commit_status', "varchar(512) DEFAULT '未知' COMMENT '提交状态' after advertiser_id");
    	$this->addColumn('{{%advertiser_map}}', 'type', "varchar(512) DEFAULT '未知' COMMENT '客户类型' after commit_status");
    	$this->addColumn('{{%advertiser_map}}', 'content', "varchar(512) DEFAULT '未知' COMMENT '资质内容' after type");
    	$this->addColumn('{{%advertiser_map}}', 'effect_status', "varchar(512) DEFAULT '未知' COMMENT '生效状态' after content");
    	$this->addColumn('{{%advertiser_map}}', 'submitDate', "timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP after effect_status");
    	$this->addColumn('{{%advertiser_map}}', 'expireDate', "timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP after submitDate");
    }

    public function down()
    {
    	$this->dropColumn('{{%advertiser_map}}', 'commit_status');
        $this->dropColumn('{{%advertiser_map}}', 'type');
        $this->dropColumn('{{%advertiser_map}}', 'content');
        $this->dropColumn('{{%advertiser_map}}', 'effect_status');
        $this->dropColumn('{{%advertiser_map}}', 'submitDate');
        $this->dropColumn('{{%advertiser_map}}', 'expireDate');
        return true;
    }
}
